<template>
  <div class="wrapper">
    <div class="main">
      <el-input placeholder="请输入关键帧" v-model="input" clearable="" class="inputArea"></el-input>
      <el-button type="primary" @click="getImage" class="buttonArea">获取</el-button>
    </div>
    <div class="imageArea" v-if="img">
      <el-image
        style="width: 800px"
        :src="img"></el-image>
    </div>
  </div> 
</template>


<script>
import api from '../api/api.js'
export default {
  data() {
    return {
      input:'',
      img:''
    }
  },

  created(){
  },

  methods:{
    getImage(){
      api._get(this.input).then(res =>  {
        this.img = window.URL.createObjectURL(res.data)
      }).catch( err =>{
        console.log(err);
      })
    }
  }
}  
</script>

<style>
.main{
  display: flex;
  justify-content: center;
  margin: 50px 0;
}
.inputArea{
  width: 400px;
}
.buttonArea{
  margin-left: 30px;
}
.imageArea{
  display: flex;
  justify-content: center;
}
</style>
